////////////////////////////////////////////////////////////////////////////////
//
//	This file is part of Woozox, see <http://code.google.com/p/woozox/>.
//
//	Copyright 2008-2009 Florian David
//
//	Woozoo is free software: you can redistribute it and/or modify
//	it under the terms of the GNU Lesser General Public License as 
//	published by the Free Software Foundation, either version 3 of 
//	the License, or (at your option) any later version.
//
//	Woozoo is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public 
//	License along with Woozoo. If not, see <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
package org.woozoo.xhtml.unittests.selectorsuite
{
	import org.woozoo.xhtml.core.base.*;
	import org.woozoo.xhtml.core.manager.cache.CacheManager;
	
	public class CaseBase
	{
		public var document : Document;
		public var results : Array;

		public function createDocumentFromXML(xml : XML) : void {
			document = new Document('test', '', xml);
		}

		[Before]
		public function resetResults() : void {
			results = [];
		}
		
		[Before]
		public function disableCache() : void {
			CacheManager.getInstance().enabled = false;
		}
		
		public function getFirstElement() : Element {
			return getElementAt(0);
		}
		public function getElementAt(index : int) : Element {
			return results[index] as Element
		}
		
		public function get resultsLen() : int {
			return results.length;
		}

		public function hasResultsAndLenEqual(value : int) : Boolean {
			return results && resultsLen == value;
		}
		
		
	}
}